﻿using MiniExcelLibs.Attributes;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace Qy.Scenario;
[SugarTable(DbTableName.OasMember)]
public class Member
{
    [SugarColumn(IsPrimaryKey = true)]
    public int Id { get; set; }
    public int DeptId { get; set; }
    public int PostId { get; set; }
    public string Name { get; set; }
    public int Sex { get; set; }
    public string IdNumber { get; set; }
    public string IdWork { get; set; }
    public DateTime DateOfBirth { get; set; }
    public string Origin { get; set; }
    public string Ethnic { get; set; }
    public string Party { get; set; }
    public DateTime WorkTime { get; set; }
    public string GraduateInstitutions { get; set; }
    public string Specialty { get; set; }
    public string Phone { get; set; }
    public string Address { get; set; }
    public string Photo { get; set; }
    public string Duties { get; set; }
    public string Duty { get; set; }
    public int Sort { get; set; }
    public int Status { get; set; }
    public int Uid { get; set; }
}

public class EditMember
{
    public int Id { get; set; }
    [Required(ErrorMessage = "请输入{0}")]
    [Display(Name = "所属部门")]
    public int DeptId { get; set; }
    [Required(ErrorMessage = "请输入{0}")]
    [Display(Name = "岗位")]
    public int PostId { get; set; }
    [Required(ErrorMessage = "请输入{0}")]
    [Display(Name = "姓名")]
    public string Name { get; set; }
    [Required(ErrorMessage = "请输入{0}")]
    [Display(Name = "性别")]
    public int Sex { get; set; }
    [Required(ErrorMessage = "请输入{0}")]
    [Display(Name = "身份证号码")]
    [RegularExpression(RegxPatterns.CardId, ErrorMessage = "{0}需要正确的身份证号码")]
    public string IdNumber { get; set; }
    [Display(Name = "工号")]
    public string IdWork { get; set; }
    [Display(Name = "出生日期")]
    public DateTime DateOfBirth { get; set; }
    [Display(Name = "籍贯")]
    public string Origin { get; set; }
    [Display(Name = "民族")]
    public string Ethnic { get; set; }
    [Display(Name = "政治面貌")]
    public string Party { get; set; }
    [Display(Name = "参加工作时间")]
    public DateTime WorkTime { get; set; }
    [Display(Name = "毕业院校")]
    public string GraduateInstitutions { get; set; }
    [Display(Name = "学习专业")]
    public string Specialty { get; set; }
    [Display(Name = "联系电话")]
    public string Phone { get; set; }
    [Display(Name = "住址")]
    public string Address { get; set; }
    [Display(Name = "头像")]
    public string Photo { get; set; }
    [Display(Name = "负责工作内容")]
    public string Duties { get; set; }
    [Display(Name = "工作岗位")]
    public string Duty { get; set; }
    [Display(Name = "排序")]
    [RegularExpression(RegxPatterns.Number, ErrorMessage = "{0}需要填写数字")]
    public int Sort { get; set; }
    [Display(Name = "人员状态")]
    public int Status { get; set; }
    public int Uid { get; set; }
}

public class ViewMember
{
    public int Id { get; set; }
    [ExcelColumnName("部门ID")]
    public int DeptId { get; set; }
    [ExcelColumnName("职务ID")]
    public int PostId { get; set; }
    [ExcelColumnName("职务")]
    public string PostName { get; set; }
    [ExcelColumnName("部门")]
    public string DeptName { get; set; }
    [ExcelColumnName("姓名")]
    public string Name { get; set; }
    [ExcelColumnName("性别")]
    public int Sex { get; set; }
    [ExcelColumnName("身份证号码")]
    public string IdNumber { get; set; }
    [ExcelColumnName("工号")]
    public string IdWork { get; set; }
    [ExcelColumnName("出生日期")]
    public DateTime DateOfBirth { get; set; }
    [ExcelColumnName("籍贯")]
    public string Origin { get; set; }
    [ExcelColumnName("民族")]
    public string Ethnic { get; set; }
    [ExcelColumnName("政治面貌")]
    public string Party { get; set; }
    [ExcelColumnName("参加工作时间")]
    public DateTime WorkTime { get; set; }
    [ExcelColumnName("毕业院校")]
    public string GraduateInstitutions { get; set; }
    [ExcelColumnName("学习专业")]
    public string Specialty { get; set; }
    [ExcelColumnName("联系电话")]
    public string Phone { get; set; }
    [ExcelColumnName("住址")]
    public string Address { get; set; }
    [ExcelColumnName("头像")]
    public string Photo { get; set; }
    [ExcelColumnName("负责工作内容")]
    public string Duties { get; set; }
    [ExcelColumnName("工作岗位")]
    public string Duty { get; set; }
    [ExcelColumnName("排序")]
    public int Sort { get; set; }
    [ExcelColumnName("人员状态码")]
    public int Status { get; set; }
    public int Uid { get; set; }

}



/// <summary>
/// 查询模型
/// </summary>
public class QueryMember : PagerInfo
{
    public bool ExportExcel { get; set; } = false;
    public int DeptId { get; set; } = 0;
    public int Status { get; set; } = 0;
    public string Name { get; set; }
    public string PostName { get; set; }
    public string IdNumber { get; set; }
    public string IdWork { get; set; }
    public int Uid { get; set; }
    public List<int> Uids { get; set; }
}
